package o;

import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public final class ye implements yc<Drawable, byte[]> {
    private final yc<xt, byte[]> ˊ;
    private final yc<Bitmap, byte[]> ˎ;
    private final uc ˏ;

    public ye(@NonNull uc ucVar, @NonNull yc<Bitmap, byte[]> ycVar, @NonNull yc<xt, byte[]> ycVar2) {
        this.ˏ = ucVar;
        this.ˎ = ycVar;
        this.ˊ = ycVar2;
    }

    @Nullable
    public tx<byte[]> ˋ(@NonNull tx<Drawable> txVar, @NonNull sc scVar) {
        Drawable drawable = (Drawable) txVar.ˋ();
        if (drawable instanceof BitmapDrawable) {
            return this.ˎ.ˋ(wh.ˊ(((BitmapDrawable) drawable).getBitmap(), this.ˏ), scVar);
        }
        if (drawable instanceof xt) {
            return this.ˊ.ˋ(ˊ(txVar), scVar);
        }
        return null;
    }

    @NonNull
    private static tx<xt> ˊ(@NonNull tx<Drawable> txVar) {
        return txVar;
    }
}
